﻿using DataAccess;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace KhoaLuan.MainSys.Controls
{
    public partial class ctNganhDaoTao : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int s = int.Parse(Request.QueryString["OrgID"]);
                NganhDaoTao_Proxy pr = new NganhDaoTao_Proxy();
                var tranings = pr.SelectByOrg(s).Select(x => new { MaNganh = x.MaNganh, TenNganh = x.TenNganh, BacHoc = x.BacHoc, HeDaoTao = x.HeDaoTao }).ToList();
                if (tranings != null)
                {
                    GrTraning.DataSource = tranings;
                    GrTraning.DataBind();
                }
                var proxy = new tbOrg_Proxy();
                var org = proxy.GetById_tbOrg_Proxy(s).ToObject<tbOrg>();
                if (org != null)
                    lbTitle.Text = "NGÀNH ĐÀO TẠO - " + org.NameOrg;
            }
        }
    }
}